﻿using System.IO.Ports;
using System.Xml.Serialization;

namespace CommonLibrary.Models.Configurations
{
    public class SerialPortConfig
    {
        #region Port information data
        public string PortName { get; set; }
        [XmlElement("BaudRate")]
        public int BaudRate { get; set; }
        [XmlElement("DataBits")]
        public int DataBits { get; set; }
        [XmlElement("Parirty")]
        public Parity Parirty { get; set; }
        [XmlElement("DataMode")]
        public DataMode DataMode { get; set; }
        [XmlElement("StopBits")]
        public StopBits StopBits { get; set; }
        [XmlElement("ClearOnOpen")]
        public bool ClearOnOpen { get; set; }
        [XmlElement("ClearWithDTR")]
        public bool ClearWithDTR { get; set; }
        [XmlElement("ReadTimeOut")]
        public int ReadTimeOut { get; set; }
        [XmlElement("WriteTimeOut")]
        public int WriteTimeOut { get; set; }
        #endregion

        #region General Serial Config data
        [XmlElement("PoolRate")]
        public int PoolRate { get; set; }
        #endregion
    }

    public enum DataMode { Text, Hex }
}
